# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-preshed
pkgver=3.0.2
pkgrel=0
pkgdesc="Cython hash tables that assume keys are pre-hashed"
url="https://github.com/explosion/preshed"
arch="all"
license="MIT"
depends="python3 py3-cymem py3-murmurhash"
makedepends="python3-dev py3-setuptools cython"
checkdepends="py3-pytest"
subpackages="$pkgname-doc"
source="preshed-$pkgver.tar.gz::https://github.com/explosion/preshed/archive/v$pkgver.tar.gz"
builddir="$srcdir/preshed-$pkgver"

build() {
	python3 setup.py build
}

check() {
	python3 setup.py install --root="$PWD/tmp_install"

	cd tmp_install/usr/lib/python3.8/site-packages

	PYTHONPATH="$PWD/usr/lib" \
		pytest-3 preshed
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

sha512sums="45e3a26491e5ce51e08e30c0acedaa8434e5c715022979c078dcf80e9b83cfb09c774e8f26aa02cb64b2ececd9f2b8e5b9d76fe81b69e6ad15a0d688345f4f20  preshed-3.0.2.tar.gz"
